package com.yueqian.dao;

import com.yueqian.domain.Permission;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IPermissionsDao {

    @Select("select * from permission p,role_permission rp where p.id=rp.permissionid and roleid=#{rid}")
    List<Permission> findByRoleId(String rid) throws Exception;

    @Select("select * from  permission ")
    List<Permission> findAll() throws Exception;

    @Insert("insert into permission(permissionName,url) values(#{permissionName},#{url})")
    void save(Permission permission) throws Exception;
}
